package vn.orderonline.core.dao.toorder;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import vn.orderonline.core.dao.common.GenericDaoImpl;
import vn.orderonline.core.dao.entity.Bill;

@Repository
public class BillDaoImpl extends GenericDaoImpl<Bill, Integer> implements BillDao {

	@Override
	public Bill getBillByOrderId(Integer orderId) {
		Criteria criteria = getSession().createCriteria(Bill.class);
		criteria.add(Restrictions.eq("orderId", orderId));
		return (Bill) criteria.uniqueResult();
	}

}
